package HP.Demo;

import java.util.Scanner;

public class SanCiJiHui {
    public static void main(String[] args) {
        String no = "zz";
        String pwd = "123";
        for (int i = 1; i <= 3; i++) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入账号:");
            String in_no =scanner.nextLine();
            System.out.println("请输入密码:");
            String in_pwd = scanner.nextLine();
            if (no.equals(in_no)&&pwd.equals(in_pwd)){
                System.out.println("ok");
                break;
            }else {
                if (i == 3){
                    System.out.println("账户被锁!");
                }else {
                    System.out.println("你还有"+(3-i)+"次机会!");
                }
            }
        }
    }
}
